package healthcheck

const (
	CheckByMySQLServerAndMonitorSystemInfoPath = "/api/v1/healthcheck/check/server-monitor"
	SaveResultPath                             = "/api/v1/healthcheck/save"
	UpdateOperationStatusPath                  = "/api/v1/healthcheck/update"

	MySQLServerAndMonitorSystemInfoHTTPBodyTemplate = `{"operation_id": %d, "mysql_server_host_ip": "%s", "mysql_server_port_num": %d, "mysql_server_server_name": "%s", "mysql_server_service_name": "%s", "monitor_system_system_type": %d, "monitor_system_host_ip": "%s", "monitor_system_port_num": %d, "monitor_system_port_num_slow": %d, "monitor_system_base_url": "%s", "start_time": "%s", "end_time": "%s", "step": "%s", "callback_addr": "%s", "login_name": "%s" }`
	UpdateOperationStatusHTTPBodyTemplate           = `{"token": "%s", "operation_id": %d, "status": %d, "message": "%s", "login_name": "%s" }`
)

type Check struct {
	Token     string `json:"token" binding:"required"`
	ServerID  int    `json:"server_id" binding:"required"`
	StartTime string `json:"start_time" binding:"required"`
	EndTime   string `json:"end_time" binding:"required"`
	Step      string `json:"step" binding:"required"`
	LoginName string `json:"login_name" binding:"required"`
}

// GetToken returns the token
func (c *Check) GetToken() string {
	return c.Token
}

// GetServerID returns the server id
func (c *Check) GetServerID() int {
	return c.ServerID
}

// GetStartTime returns the start time
func (c *Check) GetStartTime() string {
	return c.StartTime
}

// GetEndTime returns the end time
func (c *Check) GetEndTime() string {
	return c.EndTime
}

// GetStep returns the step
func (c *Check) GetStep() string {
	return c.Step
}

// GetLoginName returns the login name
func (c *Check) GetLoginName() string {
	return c.LoginName
}

type CheckByHostInfo struct {
	Token     string `json:"token" binding:"required"`
	HostIP    string `json:"host_ip" binding:"required"`
	PortNum   int    `json:"port_num" binding:"required"`
	StartTime string `json:"start_time" binding:"required"`
	EndTime   string `json:"end_time" binding:"required"`
	Step      string `json:"step" binding:"required"`
	LoginName string `json:"login_name" binding:"required"`
}

// GetToken returns the token
func (cbhi *CheckByHostInfo) GetToken() string {
	return cbhi.Token
}

// GetHostIP returns the host ip
func (cbhi *CheckByHostInfo) GetHostIP() string {
	return cbhi.HostIP
}

// GetPortNum returns the port number
func (cbhi *CheckByHostInfo) GetPortNum() int {
	return cbhi.PortNum
}

// GetStartTime returns the start time
func (cbhi *CheckByHostInfo) GetStartTime() string {
	return cbhi.StartTime
}

// GetEndTime returns the end time
func (cbhi *CheckByHostInfo) GetEndTime() string {
	return cbhi.EndTime
}

// GetStep returns the step
func (cbhi *CheckByHostInfo) GetStep() string {
	return cbhi.Step
}

// GetLoginName returns the login name
func (cbhi *CheckByHostInfo) GetLoginName() string {
	return cbhi.LoginName
}

type CheckByMySQLServerAndMonitorSystemInfo struct {
	Token                    string `json:"token" binding:"required"`
	OperationID              int    `json:"operation_id"`
	MySQLServerHostIP        string `json:"mysql_server_host_ip" binding:"required"`
	MySQLServerPortNum       int    `json:"mysql_server_port_num" binding:"required"`
	MySQLServerServerName    string `json:"mysql_server_server_name" binding:"required"`
	MySQLServerServiceName   string `json:"mysql_server_service_name" binding:"required"`
	MonitorSystemSystemType  int    `json:"monitor_system_system_type" binding:"required"`
	MonitorSystemHostIP      string `json:"monitor_system_host_ip" binding:"required"`
	MonitorSystemPortNum     int    `json:"monitor_system_port_num" binding:"required"`
	MonitorSystemPortNumSlow int    `json:"monitor_system_port_num_slow" binding:"required"`
	MonitorSystemBaseURL     string `json:"monitor_system_base_url" binding:"required"`
	StartTime                string `json:"start_time" binding:"required"`
	EndTime                  string `json:"end_time" binding:"required"`
	Step                     string `json:"step" binding:"required"`
	CallbackAddr             string `json:"callback_addr"`
	LoginName                string `json:"login_name" binding:"required"`
}

// GetToken returns the token
func (msms *CheckByMySQLServerAndMonitorSystemInfo) GetToken() string {
	return msms.Token
}

// GetOperationID returns the operation id
func (msms *CheckByMySQLServerAndMonitorSystemInfo) GetOperationID() int {
	return msms.OperationID
}

// GetMySQLServerHostIP returns the mysql server host ip
func (msms *CheckByMySQLServerAndMonitorSystemInfo) GetMySQLServerHostIP() string {
	return msms.MySQLServerHostIP
}

// GetMySQLServerPortNum returns the port number
func (msms *CheckByMySQLServerAndMonitorSystemInfo) GetMySQLServerPortNum() int {
	return msms.MySQLServerPortNum
}

// GetMySQLServerServerName returns the mysql server server name
func (msms *CheckByMySQLServerAndMonitorSystemInfo) GetMySQLServerServerName() string {
	return msms.MySQLServerServerName
}

// GetMySQLServerServiceName returns the mysql server service name
func (msms *CheckByMySQLServerAndMonitorSystemInfo) GetMySQLServerServiceName() string {
	return msms.MySQLServerServiceName
}

// GetMonitorSystemSystemType returns the monitor system system type
func (msms *CheckByMySQLServerAndMonitorSystemInfo) GetMonitorSystemSystemType() int {
	return msms.MonitorSystemSystemType
}

// GetMonitorSystemHostIP returns the monitor system host ip
func (msms *CheckByMySQLServerAndMonitorSystemInfo) GetMonitorSystemHostIP() string {
	return msms.MonitorSystemHostIP
}

// GetMonitorSystemPortNum returns the monitor system port number
func (msms *CheckByMySQLServerAndMonitorSystemInfo) GetMonitorSystemPortNum() int {
	return msms.MonitorSystemPortNum
}

// GetMonitorSystemPortNumSlow returns the monitor system port number slow
func (msms *CheckByMySQLServerAndMonitorSystemInfo) GetMonitorSystemPortNumSlow() int {
	return msms.MonitorSystemPortNumSlow
}

// GetMonitorSystemBaseURL returns the monitor system base url
func (msms *CheckByMySQLServerAndMonitorSystemInfo) GetMonitorSystemBaseURL() string {
	return msms.MonitorSystemBaseURL
}

// GetStartTime returns the start time
func (msms *CheckByMySQLServerAndMonitorSystemInfo) GetStartTime() string {
	return msms.StartTime
}

// GetEndTime returns the end time
func (msms *CheckByMySQLServerAndMonitorSystemInfo) GetEndTime() string {
	return msms.EndTime
}

// GetStep returns the step
func (msms *CheckByMySQLServerAndMonitorSystemInfo) GetStep() string {
	return msms.Step
}

// GetCallbackAddr returns the callback server address
func (msms *CheckByMySQLServerAndMonitorSystemInfo) GetCallbackAddr() string {
	return msms.CallbackAddr
}

// GetLoginName returns the login name
func (msms *CheckByMySQLServerAndMonitorSystemInfo) GetLoginName() string {
	return msms.LoginName
}

type ReviewAccuracy struct {
	Token       string `json:"token" binding:"required"`
	OperationID int    `json:"operation_id" binding:"required"`
	Review      int    `json:"review" binding:"required"`
	LoginName   string `json:"login_name" binding:"required"`
}

// GetToken returns the token
func (ra *ReviewAccuracy) GetToken() string {
	return ra.Token
}

// GetOperationID returns the operation id
func (ra *ReviewAccuracy) GetOperationID() int {
	return ra.OperationID
}

// GetReview returns the review
func (ra *ReviewAccuracy) GetReview() int {
	return ra.Review
}

// GetLoginName returns the login name
func (ra *ReviewAccuracy) GetLoginName() string {
	return ra.LoginName
}

type SaveResult struct {
	Token     string `json:"token" binding:"required"`
	Result    string `json:"result" binding:"required"`
	LoginName string `json:"login_name" binding:"required"`
}

// GetToken returns the token
func (sr *SaveResult) GetToken() string {
	return sr.Token
}

// GetResult returns the result
func (sr *SaveResult) GetResult() string {
	return sr.Result
}

// GetLoginName returns the login name
func (sr *SaveResult) GetLoginName() string {
	return sr.LoginName
}

type UpdateOperationStatus struct {
	Token       string `json:"token" binding:"required"`
	OperationID int    `json:"operation_id" binding:"required"`
	Status      int    `json:"status" binding:"required"`
	Message     string `json:"message" binding:"required"`
	LoginName   string `json:"login_name" binding:"required"`
}

// GetToken returns the token
func (uos *UpdateOperationStatus) GetToken() string {
	return uos.Token
}

// GetOperationID returns the operation id
func (uos *UpdateOperationStatus) GetOperationID() int {
	return uos.OperationID
}

// GetStatus returns the status
func (uos *UpdateOperationStatus) GetStatus() int {
	return uos.Status
}

// GetMessage returns the message
func (uos *UpdateOperationStatus) GetMessage() string {
	return uos.Message
}

// GetLoginName returns the login name
func (uos *UpdateOperationStatus) GetLoginName() string {
	return uos.LoginName
}
